﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters.Kardex.Search
{
    public class PresenterSeachKardex
    {
        ISearchKardexView view;
        public PresenterSeachKardex(ISearchKardexView View)
        {
            view = View;
        }

        public void SearchKardex()
        {
            try
            {
                Model.Kardex k = new Model.Kardex() { Person = new Model.Person() { PersonId = view.PersonIdRelative, LastNames = view.PersonLastNamesRelative, Names = view.PersonNamesRelative } };
                view.KardexFinded = ManagerKardex.SearchKardexByParameter(k, view.StateKardex);
            }
            catch(Exception ex)
            {
                view.KardexFinded = null;
                view.NotifyErrorMessage(ex.Message);
            }
        }
    }
}
